﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Print 打印表格</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" /><link href="../demo.css" rel="stylesheet" type="text/css" />

    
    <script src="../../scripts/boot.js" type="text/javascript"></script>
    

    <script src="js/jquery.PrintArea.js" type="text/javascript"></script>
</head>
<body>
    <h1>Print 打印表格</h1>      

    <div style="padding-bottom:5px;">
        
        
        <input type="button" value="打印" onclick="printGrid()"/>
        
        
    </div>
    <div id="printArea">
        <div id="datagrid1" class="mini-datagrid" style="width:700px;height:280px;" 
            url="../data/AjaxService.jsp?method=SearchEmployees" 
            sizeList="[5,10,20,50]" pageSize="10"
        >
            <div property="columns">
                <div type="indexcolumn" ></div>
                <div field="loginname" width="120" headerAlign="center" allowSort="true">员工帐号</div>    
                <div field="name" width="120" headerAlign="center" allowSort="true">姓名</div>                            
                <div field="gender" width="100" renderer="onGenderRenderer" align="center" headerAlign="center">性别</div>
                <div field="salary" width="100" allowSort="true">薪资</div>                                    
                <div field="age" width="100" allowSort="true">年龄</div>
                <div field="createtime" width="100" headerAlign="center" dateFormat="yyyy-MM-dd" allowSort="true">创建日期</div>                
            </div>
        </div>   
    </div>
    <script type="text/javascript">
        mini.parse();
        
        var grid = mini.get("datagrid1");
        grid.load();



        function printGrid() {
            
            $("#printArea").printArea();  
        }
        
        ///////////////////////////////////////////////////////
        function onGenderRenderer(e) {
            if (e.value == 1) return "男";
            else if (e.value == 2) return "女";
            return "";
        }        

    </script>

    <div class="description">
        <h3>Description</h3>
        
    </div>
</body>
</html>